<?php
// +----------------------------------------------------------------------
// | WoShiMaiJia Projcet
// +----------------------------------------------------------------------
// | Copyright (c) 2010 http://woshimaijia.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: xinqiyang <517577550@qq.com>
// +----------------------------------------------------------------------
/**
 * 首页模块
 * @author xinqiyang
 * @date   2010-4-10
 *
 */
class IndexAction extends AppBaseAction {
	

	function index()
	{

		
		
		//首页调用下 URL信息
		$d = D('url');
		$ids = $d->field('id')->order('rand()')->limit(24)->select();
		$this->assign('gogo',$d->getUrls($ids));
		
		//加载新来的人
		$u = D('user');
		$newids = $u->field('id')->where("status =1 and image_id <> ''")->limit(8)->order('createtime desc')->select();
		$this->assign('newusers',$u->getUsers($newids));
		
		
		//最新加入的品牌
		$b = D('brand');
		$bids = $b->field('id')->where("image_id<>''")->select();
		$this->assign('brand',$b->getBrands($bids));
		
		
		//推荐大家购买的
		$g = D('goods');
		//加载晒晒的功能了,显示大家推荐的
		$ids = $g->field('id')->where("image_id<>'' and showtype='1'")->select();
		$this->assign('goods',$g->getGoods($ids));
		
		
		//调用评论信息
		$d = D('comment');
		$comments = $d->getComments(strin(D('goods')->field('id')->where('id in (417,426,427,428,429,430)')->select()),'goods',6);
		$this->assign('comments',$comments);
		$this->assign('module','show');
		$this->assign('model','goods');
		
		$this->page = array('title'=>'我是买家 首页','tags'=>'逛逛,逛店,逛街,晒晒,分享,购物体验分享,我是买家','desc'=>'我的买家,买家分享社区');
		
		//获取数据信息
		$num['user'] = $u->getUserTotal();
		
		$this->assign('num',$num);
		$this->t();
	}
	
	public function gomore()
	{
		$this->page = array('title'=>'我是买家 首页更多','tags'=>'逛逛,逛店,逛街,晒晒,分享,购物体验分享,我是买家','desc'=>'我的买家,买家分享社区');
		
		//获取更多
		$this->t();
	}


	//


	//



	//
}

?>